package com.chat;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class Demo02 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("d:/1.txt");
        byte[] buffer = new byte[5];
        int count;
        while((count = fis.read(buffer)) != -1){
            System.out.println("我本次读到了" + count + "个字节");
            System.out.println(new String(buffer,0,count));
        }
    }
}
